import { http } from '@/utils/http'

// 获取token
export const userLogin = (data) => {
  return http.post('/dingding/login?authCode=' + data)
}

// 获取用户信息
export const getUserInfo = (data) => {
  return http.get('/getInfo')
}

// 获取用户信息
export const getUserInfoAll = (data) => {
  return http.get('/business/system/role/getInfoApp')
}

// 登录
export const loginAccount = (data) => {
  return http.post('/login', data)
}

// 钉钉登录
export const dingLogin = (data) => {
  return http.post('/applet/login', data)
}

// 获取用户详细信息
export const getUserInfoDetail = (data) => {
  return http.get('/system/user/getUserById/' + data)
}

// 获取字典数据
export const getDictData = (data) => {
  return http.get('/system/dict/data/type/' + data)
}

// 获取基地数据
export const getBaseData = () => {
  return http.get('/business/plant/getWorkPlace')
}

// 获取工厂数据
export const getFactoryData = (data) => {
  return http.get('/business/plant/getPlantByWorkPlace', data)
}

// 获取部门树
export const getDeptTree = () => {
  return http.get('/system/user/deptTree')
}

// 根据部门id查询岗位数据
export const getPostData = (data) => {
  return http.get('/system/post/optionselect', data)
}

// 获取城市字典
export const getCityDict = (data) => {
  return http.get('/common/getAdministrative', data)
}

// 修改学历信息
export const updateSchoolInfo = (data) => {
  return http.post('/business/userSchool/update', data)
}

// 新增学历信息
export const addSchoolInfo = (data) => {
  return http.post('/business/userSchool/insert', data)
}

// 删除学历信息
export const deleteSchoolInfo = (id) => {
  return http.delete('/business/userSchool/delete/' + id)
}

// 修改工作经历
export const updateWorkInfo = (data) => {
  return http.post('/business/company/update', data)
}

// 新增工作经历
export const addWorkInfo = (data) => {
  return http.post('/business/company/insert', data)
}

// 删除工作经历
export const deleteWorkInfo = (id) => {
  return http.delete('/business/company/delete/' + id)
}

// 修改人员证书
export const updateCertificateInfo = (data) => {
  return http.post('/business/certificates/update', data)
}

// 新增人员证书
export const addCertificateInfo = (data) => {
  return http.post('/business/certificates/insert', data)
}

// 删除人员证书
export const deleteCertificateInfo = (id) => {
  return http.delete('/business/certificates/delete/' + id)
}

// 修改家庭成员
export const updateFamilyInfo = (data) => {
  return http.post('/business/relationship/update', data)
}

// 新增家庭成员
export const addFamilyInfo = (data) => {
  return http.post('/business/relationship/insert', data)
}

// 删除家庭成员
export const deleteFamilyInfo = (id) => {
  return http.delete('/business/relationship/delete/' + id)
}

// 修改用户信息
export const updateUserInfo = (data) => {
  return http.post('/system/user/updateRoster', data)
}
